<template>
	<view>
		<view class="top-box">
			<view class="top-cont">
				<view class="top-cont-one" @click="coverClske">
					<image :src="livebdata.avatar_url"></image>
					<view class="top-cont-one-but">更换封面</view>
				</view>
				<view class="top-cont-text">
					<input class="title" type="text" v-model="livebdata.name" />
					<view class="title" @click="toggleMask('show',1)">{{introduction}}</view>
				</view>
			</view>
		</view>
		<view @click="open" class="but">开启视频直播</view>
		<ygc-comment ref="ygcComment" :placeholder="'请输入直播简介'" @pubComment="pubComment"></ygc-comment>
	</view>
</template>

<script>
	import ygcComment from '@/components/ygc-comment/ygc-comment.vue';
	import {
		getToken
	} from '@/util/tokeCookien.js'
	export default {
		data() {
			return {
				context: null,
				livebdata: {}, //用户信息
				introduction: '真人直播', //简介
			}
		},
		components: {
			ygcComment
		},
		onShow() {
			this.livebdata = getToken()
		},
		methods: {
			//点击简介弹出框
			toggleMask(type, xz) {
				this.togglexz = xz
				this.$refs.ygcComment.content = '';
				this.$refs.ygcComment.toggleMask(type);
			},
			//直播简介
			pubComment(commentContent1) {
				console.log(commentContent1)
			},
			//更换封面
			coverClske() {
				const _this=this
				uni.chooseImage({
					count: 1, //默认9
					success: (chooseImageRes) => {
						const tempFilePaths = chooseImageRes.tempFilePaths[0];
						_this.livebdata.avatar_url=tempFilePaths
					}
				});
			},
			//跳转页面
			open() {
				uni.navigateTo({
					url: '/pages/tui/tui'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top-box {
		width: 80%;
		border-radius: 20rpx;
		background: rgba(48, 48, 48, .4);
		padding: 20rpx;
		margin: auto;
		margin-top: 100rpx;

		.top-title {
			color: white;
			font-size: 30rpx;

		}

		.top-cont {
			display: flex;
		}

		.top-cont-text {
			.title {
				margin: 20rpx 0;
				width: 100%;
				padding-left: 30rpx;
				color: #fff;
				font-size: 30rpx;
				display: block;
			}
		}

		.top-cont-one {
			position: relative;
			width: 150rpx;
			height: 150rpx;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			flex-direction: column;
		}

		.top-cont-one>image {
			width: 150rpx;
			height: 150rpx;
			position: absolute;
			top: 0rpx;
		}

		.top-cont-one-but {
			width: 150rpx;
			position: relative;
			z-index: 1;
			background: rgba(0, 0, 0, .6);
			color: white;
			padding-top: 5rpx;
			padding-bottom: 5rpx;
			text-align: center;
			font-size: 24rpx;
		}

	}

	.but {
		position: fixed;
		bottom: 50rpx;
		width: 80%;
		left: 10%;
		border-radius: 40rpx;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
		text-align: center;
		font-size: 30rpx;
		color: white;
		background: #ed4141;
	}
</style>
<!-- <template>
	<view class="content">
		<yyqLivePusher></yyqLivePusher>
	</view>  
</template>

<script>
	import yyqLivePusher from '@/components/yyq-LivePusher/yyq-LivePusher.vue'
	export default {
		data() {
			return {

			}
		},
		methods: {
			
		},
		components: {
			yyqLivePusher
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background: #000;
		overflow: hidden;
		width: 750upx;
		position: fixed;
	}
</style>
 -->
